//
//  UILabel+Extensions.swift
//  扩展文件
//
//  Created by 伏文东 on 2018/2/5.
//  Copyright © 2018年 伏文东. All rights reserved.
//

import UIKit

extension UILabel {
    /// 创建文本标签
    ///
    /// - Parameters:
    ///   - text:       文本
    ///   - fontSize:   字体大小
    ///   - color:      颜色
    /// - Returns:      UILabel
    static func labelWithText(text: String, fontSize: CGFloat, color: UIColor) -> UILabel {
        
        let label = UILabel()
        label.text = text
        label.font = UIFont.systemFont(ofSize: fontSize)
        label.textColor = color
        label.numberOfLines = 0
        
        label.sizeToFit()
        
        return label
    }
}
